package nabaixin.com.activity.premium;

import nabaixin.com.activity.R;
import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TabHost;
import android.widget.TabWidget;
import android.widget.TextView;
import android.widget.TabHost.TabSpec;

public class PremiumsDetailTabActivity extends TabActivity {
	private TabHost mTabHost;
	private Context context;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		context = PremiumsDetailTabActivity.this;
		
		mTabHost = getTabHost();  
		LinearLayout ll = (LinearLayout)mTabHost.getChildAt(0);  
		TabWidget tw = (TabWidget)ll.getChildAt(0); 
		
		RelativeLayout tabIndicator1 = (RelativeLayout) LayoutInflater.from(this).inflate(R.layout.tab_child, tw, false);  
		TextView tvTab1 = (TextView)tabIndicator1.findViewById(R.id.title); 
		tvTab1.setText(R.string.premiumsdetail_top_detail);  
		TabSpec mTabSpc1 = mTabHost.newTabSpec("TAB_1")  
		        .setIndicator(tabIndicator1)  
		        .setContent(new Intent(this, PremiumsDetailActivity.class));
		
		RelativeLayout tabIndicator2 = (RelativeLayout) LayoutInflater.from(this).inflate(R.layout.tab_child, tw, false);  
		TextView tvTab2 = (TextView)tabIndicator2.findViewById(R.id.title); 
		tvTab2.setText(R.string.premiumsdetail_top_effectiveplaces);  
		TabSpec mTabSpc2 = mTabHost.newTabSpec("TAB_2")  
		        .setIndicator(tabIndicator2)  
		        .setContent(new Intent(this, PremiumsEffectiveActivity.class));
		
		mTabHost.addTab(mTabSpc1);
		mTabHost.addTab(mTabSpc2);
	}
}
